﻿using Frame.Core.Models;
using Frame.Core.Models.Dto;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Frame.Core.IServices.Admin
{
    public interface IUserService : IBaseService<Users>
    {

        Task<List<UsersDto>> GetUserList(PagingInfoViewModel<Users> pagingInfo, Expression<Func<Users, bool>> whereExpression);

        /// <summary>
        /// 查询单个用户
        /// </summary>
        /// <param name="whereExpression"></param>
        /// <returns></returns>
        Task<Users> GetUserFirst(Expression<Func<Users, bool>> whereExpression);

        Task<List<string>> GetPermissionsAsync();
        /// <summary>
        /// 当前登录用户的角色列表
        /// </summary>
        /// <returns></returns>
        Task<List<int>> GetIdentityRoleIDs(string userName);

        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="user"></param>
        /// <param name="arrRoles"></param>
        /// <param name="arrTitles"></param>
        /// <returns></returns>
        Task AddUserAsync(Users user, int[] arrRoles, int[] arrTitles);

        Task EditUserAsync(Users user, int[] arrRoles, int[] arrTitles);
    }
}
